import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author ml
 * @create 2017-11-07--13:38
 */
public class test {

    public static IMyPool myPool = MyPoolFactory.getInstance();

    public static void main(String[] args) {
        for(int i=0;i<27;i++){

            MyPooledConnection myPooledConnection = myPool.getMyPooledConnection();
            ResultSet query = myPooledConnection.query("select * from user");

            MyPooledConnection myPooledConnection2 = myPool.getMyPooledConnection();
            ResultSet query2 = myPooledConnection.query("select * from users");

            try {
                while (query2.next()) {

                    System.out.println(query2.getString("u_username") + "," + "使用的管道：" + myPooledConnection2.getConnection());


                }
                while (query.next()) {

                    System.out.println(query.getString("username") + "," + "使用的管道：" + myPooledConnection.getConnection());


                }
//                myPooledConnection.close();
//                myPooledConnection2.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }


        }


    }
}
